//
//  ViewController.m
//  fun
//
//  Created by student on 16/2/18.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)change:(id)sender
{  int value=self.jdt.value;
    self.lable.text=[NSString stringWithFormat:@"%i",value];
    
    
}

- (IBAction)end:(id)sender
{
    [self.view endEditing:YES];
}

- (IBAction)toch:(id)sender
{
    if(self.as.selectedSegmentIndex == 0)
    {
        self.left.hidden = NO;
        self.right.hidden = NO;
        self.bs.hidden = YES;
    }
    else
    {
        self.left.hidden = YES;
        self.right.hidden = YES;
        self.bs.hidden = NO;
    }
 
 
    
    
    
}

- (IBAction)toch1:(UIButton *)sender
{
    UIActionSheet *sheet = [[UIActionSheet alloc]
            initWithTitle:@"你确定要按吗" delegate:self cancelButtonTitle:@"想想" destructiveButtonTitle:@"确定"  otherButtonTitles: nil];
     [sheet showInView:self.view];
}
#pragma mark - UIActionSheetDelegate Method 操作表的代理方法
- (void)Sheet:(UIActionSheet *)actionSheet Button:(NSInteger)buttonIndex
{
if(buttonIndex == actionSheet.destructiveButtonIndex)
{
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"哈哈哈"  // 标题
                                                            message:@"去死吧"  // 信息
                                                           delegate:self         // 代理人(即哪个对象来处理这个UIAlertView对象的事件)
                                                  cancelButtonTitle:@"确定"       // 按钮上的文字
                                                  otherButtonTitles:nil];        // 更多按钮
        [alertView show];

        
        
            }

    
    
    
}






@end
